// 类型推论

export let num = 1


export let arr = [1,2,3, true, '123', () => {}, new Date()]




// 类型保护
document.addEventListener('click', e => {
  // e: 
  // e.target
  // 类型断言
  const tar = e.target as HTMLElement;

  if(tar) {
    tar.classList.add('active')
    tar.className = 'qwe'
    if(tar.parentNode) {
      (tar.parentNode as HTMLElement).remove()
    }
  }
 
})